package com.star.platforms.controller;

import com.star.platforms.common.ResultBean;
import com.star.platforms.dao.QuestionMapper;
import com.star.platforms.vo.QuestionVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author sam
 */
@RestController
@RequestMapping("/question")
public class QuestionController {
    @Autowired
    QuestionMapper questionMapper;

    @RequestMapping(value = "/getQuestionList", method = RequestMethod.GET)
    public ResultBean<List<QuestionVo>> getQuestionList(int size) {
        List<QuestionVo> dataList = questionMapper.selectListLimit(size);
        return new ResultBean<>(200, "成功", dataList);
    }
}
